package com.tensquare.recruit.dao;

import com.tensquare.recruit.pojo.Enterprise;
import com.tensquare.recruit.pojo.Recruit;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * Created by WF on 2019/9/18 10:07
 */
public interface RecruitDao extends JpaRepository<Recruit,String>,JpaSpecificationExecutor<Recruit> {
    //1.根据状态值及创建时间倒序排序取前4位（查询推荐职位）
    List<Recruit> findTop4ByStateOrderByCreatetimeDesc(String state);
    //2.需求分析：查询状态不为0并以创建日期降序排序，查询前12条记录(查询最新职位)
    List<Recruit> findTop12ByStateNotOrderByCreatetimeDesc(String state);
}
